package com.jerem.gwt.bredgolf.server;

import javax.jdo.annotations.Element;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

import java.util.ArrayList;
import java.util.List;

@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true")
public class GolfClubDTO {
	
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key id;
	
	@Persistent
	private String nom;
	@Persistent
	private String adresse;
	@Persistent
	private String tel;
	@Persistent
	private double lattitude;
	@Persistent
	private double longitude;
	
	@Persistent(mappedBy = "golfClub")
    @Element(dependent = "true")
	private List<GolfParcoursDTO> listeParcours = new ArrayList<GolfParcoursDTO>();

	public GolfClubDTO() {
	}
	
	public GolfClubDTO(String nom, String adresse, String tel, double lattitude, double longitude,
			        List<GolfParcoursDTO> listeParcours) {
		super();
		this.nom = nom;
		this.adresse = adresse;
		this.tel = tel;
		this.lattitude = lattitude;
		this.longitude = longitude;
		this.listeParcours = listeParcours;
	}



	public String getNom() {
		return nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

	public String getAdresse() {
		return adresse;
	}

	public void setAdresse(String adresse) {
		this.adresse = adresse;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}
	
	public Key getId() {
		return id;
	}
	
	public void setLattitude(double lattitude) {
		this.lattitude = lattitude;
	}

	public double getLattitude() {
		return lattitude;
	}

	public void setLongitude(double longitude) {
		this.longitude = longitude;
	}

	public double getLongitude() {
		return longitude;
	}

	public List<GolfParcoursDTO> getListeParcours() {
		return listeParcours;
	}

	public void setListeParcours(List<GolfParcoursDTO> listeParcours) {
		this.listeParcours = listeParcours;
	}

}